<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script>

    const person = { name: "zs", age: 18, gender: "男" };
    //  1.解构 👍下方这种写法更简洁
    //  作用: 直接从person中声明了name, 等价于 const name = person.name
    const { name } = person


    const list = [1, 2, 3];

    // slice不写参数, 作用: 复制一份新的数组
    const newList = list.slice();
    // 2. 扩展运算符
    // 🔔 [...list] 完全等价于slice
    const newList2 = [...list]
    console.log('newList, newList2  ----->  ', newList, newList2);


  </script>
</body>

</html>